package com.woniu.order.client;

import com.woniu.model.Result;
import com.woniu.order.cliententity.entity.FlowHandle;
import com.woniu.order.cliententity.form.AddHandelForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "flow-server",path = "/flow")
public interface FlowClient {
    /**
     * 查询一个订单当前走到哪一步了
     * @param orderNum 订单号
     */
    @GetMapping("/flowHandle/findNow/{orderNum}")
    @ApiOperation("查询一个订单当前走到哪一步了")
    Result<FlowHandle> locationConfirm(@PathVariable("orderNum") String orderNum);

    /**
     * 创建流程执行
     * @param form 添加流程执行form
     */
    @PostMapping("/flowHandle/add")
    @ApiOperation("创建流程执行")
    Result<FlowHandle> add(@RequestBody AddHandelForm form);


}
